def init_product_resource_data(engine):
    from mall.models.resource import Resource
    from mall.models.product import Product
    from mall.models.product import ProductGallery
    conn = engine.connect()
    from sqlalchemy.sql import select
    resource_list = conn.execute(select([Resource.__table__]))
    product_list = conn.execute(select([Product.__table__]))

    resources_ids =  [r[0] for r in resource_list]
    for product in product_list:
        for resource in resources_ids:
            print(product[0], resource[0])
            conn.execute(ProductGallery.__table__.insert(),
                         product_id=product[0],
                         resource_id=resource)

